﻿@{
    ViewBag.Title = "容器返修登记";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}
<link href="~/Content/css/container_purchaseinstock_print.css" rel="stylesheet" media="print" />
<link href="~/Content/css/ContainerPurchaseEntherModify.css" rel="stylesheet" />
<style type="text/css">
    .print {
        display: none;
    }

    .btn-group input {
        height: 2em;
        vertical-align: bottom;
    }

    .btn-group label {
        line-height: 2em !important;
    }

    .tool_c {
        padding: 10px 0 0 0;
    }

    .btn-group {
        padding: 0 10px 0 0;
    }

        .btn-group a:first-child {
            margin: 0 0.5em 0 0;
        }
</style>

<script type="text/javascript">
    $(function () {
        Index.init();
    });

    var Index = {
        defaultDate: '@ViewData["defaultDate"].ToString()',
        dataList: { "登记": null, "档案": null },
        unitName: "北汽福田汽车股份有限公司冲压工厂",
        title: "容器返修登记单",
        curUnit: '@ViewData["curUnit"].ToString()',
        curUserName: '@ViewData["curUserName"].ToString()',
        curDate: '@ViewData["curDate"].ToString()',
        curTime: '@ViewData["curTime"].ToString()',
        FDocuTypeNo: "RX",
        printItemTemplate: "",
        selected: null,
        init: function () {
            with (Index) {
                printItemTemplate = $("#print1 .page").html();

                initControl();

                loadDataList();

                initSelect();
            }
        },
        initSelect: function () {
            var o = {
                "登记": "r11,r12,r13,r14,r15,r16,r17,r18,r21".split(","),
                "档案": "r11,r16,r17,r19,r20,r21".split(",")
            };

            $("[name=ra1]").on("click", function () {
                $(".r1").hide(0);

                var arr = o[$(this).val()];

                arr.forEach(function (cur) {
                    $(".{0}".format(cur)).fadeIn(100);
                });
            });

            $("[name=ra1]:first").trigger("click");
        },
        initControl: function () {
            $("[month-control]").val(Index.defaultDate);

            $.renderMy97Datepicker();

            $("[month-control]").on("click", function () {
                WdatePicker({ dateFmt: 'yyyyMM', minDate: '2000-1', maxDate: '2050-12' });
            });

            $('select').bindSelect();

            $("#FHappenComNO1").bindSelect({
                url: "/WareHouse/Container/GetSupplierJson",
                id: "UnitNO",
                text: "UnitNOShortName"
            });

            //批次查询 btn_search1
            $("#btn_search1").on("click", function () {
                var val = $("[name=ra1]:checked").val();

                ("登记" == val) && (function () {
                    var $gridList1 = $("#gridList1");

                    var conn1 = $.buildPostParam("FDocuNO,FHappenComNO,FContainerNO,FCurDate,Fcredence,FAccountDate", "1");

                    conn1["FAccountDate1"] = Index.defaultDate;

                    conn1["isArchive"] = false;

                    conn1["isDefaultDate"] = Index.defaultDate == $("#FAccountDate1").val();

                    $gridList1.jqGrid('setGridParam', {
                        postData: conn1,
                    }).trigger('reloadGrid');
                })();

                ("档案" == val) && (function () {
                    var $gridList2 = $("#gridList2");

                    var conn2 = $.buildPostParam("FDocuNO,FHappenComNO,FContainerNO,FCurDate,Fcredence,FAccountDate", "1");

                    conn2["isArchive"] = true;

                    conn2["isDefaultDate"] = Index.defaultDate == $("#FAccountDate1").val();

                    $gridList2.jqGrid('setGridParam', {
                        postData: conn2,
                    }).trigger('reloadGrid');
                })();

            });
            //打印
            $("#butnPrint1").on("click", function () {
                var val = $("[name=ra1]:checked").val();

                ("登记" == val) && (function () {
                    Index.goPrint($("#print1"));
                })();

                ("档案" == val) && (function () {
                    Index.goPrint($("#print2"));
                })();
            });
            //导出
            $("#butnExport1").on("click", function () {
                var val = $("[name=ra1]:checked").val();

                ("登记" == val) && (function () {
                    var param = { id: "V_RQK_12_MX_StoConListAcco", param: Index.buildExportConn("FDocuNO,FHappenComNO,FContainerNO,FCurDate,Fcredence,FAccountDate,FDocuTypeNo".split(","), "1") };

                    var url = "/Common/ExcelExportById?{0}".format($.param(param));

                    location.href = url;
                })();

                ("档案" == val) && (function () {
                    var param = { id: "V_RQK_14_MX_StoConListAcco_Mid", param: Index.buildExportConn("FDocuNO,FHappenComNO,FContainerNO,FCurDate,Fcredence,FAccountDate,FDocuTypeNo".split(","), "1") };

                    (Index.defaultDate != $("#FAccountDate1").val()) && (param["id"] = "V_RQK_16_MX_StoConListAcco_Arc");

                    var url = "/Common/ExcelExportById?{0}".format($.param(param));

                    location.href = url;
                })();
            });

            $("#butnAdd1").on("click", function () {
                location.href = "/WareHouse/Container/ContainerRepairEdit?type=add";
            });

            $("#butnDelete1").on("click", function () {
                // UseUnit,FAccountDate,FDocuTypeNO,FDocuNO,FCurDate,FHappenComNO,FDocuID,FDocuListID,FContainerNO,FQuantity,FPrice,FStoreNO,FStoreSetNO,FCreateBy,FCredence,FDescription,FDescription2,FFacNum,FItemDesc,DocumentNumType,FDouBarCode
                // FDocuListID, FDocuID,FStoreNO, FStoreSetNO, FDescription2, FFacNum, FItemDesc, DocumentNumType, FDouBarCode
                var idxs = [], jsonDataList = [];

                var cboxs = $("#gridList1 [name=checkbox]:checked").toArray();

                cboxs.forEach(function (item) {
                    idxs.push($(item).parents("tr").index() - 1);
                });

                idxs.forEach(function (item) {
                    jsonDataList.push(Index.dataList["登记"].rows[item]);
                });

                !!cboxs.length || $.modalAlert("请先选择要删除的单据记录", "error");

                !!cboxs.length && $.post("/WareHouse/Container/DeleteContainerRepair",
                    { postDataList: JSON.stringify(jsonDataList) },
                    function (rstList) {
                        rstList && rstList.forEach(function (item) {
                            !item["resultState"] && (function () {
                                console.log("删除失败一条记录");
                            })();

                            !!item["resultState"] && (function () {
                                console.log("成功删除一条记录");
                            })();
                        });

                        $("#btn_search1").trigger("click");

                    },
                    "json"
                    );
            });

            $("#butnUpdate1").on("click", function () {
                !!Index.selected || $.modalAlert("请先选择要修改的记录");

                !!Index.selected && (function () {
                    var cols = "FDocuNO,FPrice,FContainerNO,FQuantity".split(",");

                    cols.forEach(function (col) {
                        $("#{0}".format(col)).val(Index.selected[col]);
                    });

                    $("#popup").removeClass("display_none");

                    $("#butn_c_2").removeClass("display_none");

                    $("#butn_c_1").addClass("display_none");
                })();
            });

            $("#butnClose").on("click", function () {
                $("#popup").addClass("display_none");

                $("#butn_c_2").addClass("display_none");

                $("#butn_c_1").removeClass("display_none");
            });

            $("#butnUpdate2").on("click", function () {
                var cols = "FDocuNO,FPrice,FContainerNO,FQuantity".split(",");

                var rowData = {};

                cols.forEach(function (item) {
                    rowData[item] = $("#{0}".format(item)).val();
                });

                var postData = $.extend(Index.selected, rowData);

                $.post("/WareHouse/Container/UpdateContainerRepair",
                    { postData: JSON.stringify(postData) },
                    function (res) {
                        var status = parseInt(res["resultState"], 10);

                        !status && (function () {
                            console.log("修改操作执行失败！");
                        })();

                        !!status && (function () {
                            console.log("修改操作执行成功");
                        })();

                        $("#btn_search1").trigger("click");
                    }, "json");
            });

            $("#butnGoBill1").on("click", function () {
                !!Index.selected || $.modalAlert("请先选择要查看单据的记录");

                !!Index.selected && (function () {
                    var param = { type: "bill", FDescription_DOC: Index.selected["FDescription_DOC"], FHappenComNO: Index.selected["FHappenComNO"], FDocuNO: Index.selected["FDocuNO"], isArchive: "档案" == $("[name=ra1]:checked").val(), isDefaultDate: Index.defaultDate == $("#FAccountDate1").val() };

                    location.href = "/WareHouse/Container/ContainerRepairEdit?{0}".format($.param(param));
                })();
            });
            //审核
            $("#butnAudit1").on("click", function () {
                var idxs = [], jsonDataList = [];

                var cols = "FCreateBy,FDocuNO,FAccountDate".split(",");

                var cboxs = $("#gridList1 [name=checkbox]:checked").toArray();

                cboxs.forEach(function (item) {
                    idxs.push($(item).parents("tr").index() - 1);
                });

                !!cboxs.length || $.modalAlert("请先选择要审核的单据记录", "error");

                idxs.forEach(function (item) {
                    var obj = { DocumetStatus: Index.FDocuTypeNo, Status: "1" };

                    cols.forEach(function (col) {
                        col in item && (obj[col] = Index.dataList["登记"].rows[col]);
                    });
                    jsonDataList.push(obj);
                });
                //UseUnit FCreateBy Status DocumetStatus FDocuNO FAccountDate
                !!cboxs.length && $.post("/WareHouse/Container/AduitContainer",
                    { postDataList: JSON.stringify(jsonDataList) },
                    function (rstList) {
                        rstList && rstList.forEach(function (item) {
                            !item["resultState"] && (function () {
                                console.log("审核失败一条记录");
                            })();

                            !!item["resultState"] && (function () {
                                console.log("成功审核一条记录");
                            })();
                        });

                        $("#btn_search1").trigger("click");
                    },
                    "json"
                    );
            });

        },
        goPrint:function(printer){
            var ids = [];

            var cboxs = $("#gridList1 [name=checkbox]:checked").toArray();

            cboxs.forEach(function (item) {
                ids.push("'{0}'".format($(item).val()));
            });

            console.log(ids.toString());

            !ids.length && $.modalAlert("请选择需要打印的单据！", "error");

            !!ids.length && (function () {
                var columnInfos = {
                    "FHappenComName": "来料单位名称",
                    "FCredence": "凭证编号",
                    "FCurDate": "单据日期",
                    "FDescription_DOC": "摘要说明",
                    "FDocuNO": "单据编号",
                    "FContainerNO": "容器编号",
                    "FContainerName": "容器名称",
                    "FQuantity_KP": "开票数量",
                    "FQuantity": "实际数量",
                    "FPrice": "单价<br/>(元)",
                    "FAmount": "金额<br/>(元)",
                    "FStoreName": "仓库名称",
                    "FStoreSetNO": "定置编号",
                    "FDescription": "备注说明"
                };

                $.post("/WareHouse/Container/GetPrintDetailsData",
                    {
                        isDefaultDate: Index.defaultDate == $("#FAccountDate").val(),
                        isArchive: false,
                        ids: ids.join(",")
                    },
                    function (data) {
                        var container = $("#print1").empty();

                        var indexCols = "unitName,title".split(",");

                        data.forEach(function (item) {

                            for (var idx in indexCols) {
                                item[indexCols[idx]] = Index[indexCols[idx]];
                            }
                            item["bar_code"] = "/Common/GetBarCode?text={0}&width=300&height=90".format(item["FDocuNO"]);

                            item["qr_code"] = "/Common/GetQrcode?text={0}".format(item["FDocuNO"]);

                            var total_page = 0, rows = 16, maxRows = item.dataList.length, idx = 0;

                            total_page = Math.ceil(maxRows / (rows * 1.0));

                            item["total"] = maxRows;

                            for (var i = 0; i < total_page; i++) {
                                var start = i * rows, end = (i + 1) * rows;

                                (maxRows < end) && (end = Math.ceil(maxRows % rows));

                                var pageCols = "total,curUser,curDate,curTime,unitName,title,bar_code,qr_code,FDocuNO,FCredence,FHappenComName,FCurDate,FDescription_DOC".split(',');

                                var pageData = { total_page: total_page, page: (i + 1), dataList: [], bill_total: 0, real_total: 0, amount_total: 0 };

                                pageCols.forEach(function (pageCol) {
                                    pageData[pageCol] = item[pageCol];
                                });

                                var deleteCols = "FHappenComName,FCredence,FCurDate,FDescription_DOC,FDocuNO".split(',');

                                for (var j = start; j < end; j++) {
                                    deleteCols.forEach(function (deleteCol) {
                                        delete item.dataList[j][deleteCol];
                                    });


                                    pageData.dataList.push(item.dataList[j]);

                                    pageData.bill_total += parseInt(item.dataList[j]["FQuantity_KP"], 10);

                                    pageData.real_total += parseInt(item.dataList[j]["FQuantity"], 10);

                                    pageData.amount_total += parseFloat(item.dataList[j]["FAmount"]);
                                }

                                Index.buildPrintData(pageData, columnInfos).appendTo(container);
                            }
                        });

                        printer.jqprint();
                    }, "json");
            })();
        },
        buildExportConn: function (params, num) {
            var conn = "";

            !num && (num = "");

            params.forEach(function (item) {
                var val = $("#{0}{1}".format(item, num)).val();

                !!val && (conn += ("and {0} = '{1}'".format(item, val)));
            });

            return conn;
        },
        loadDataList: function () {
            var conn1 = $.buildPostParam("FDocuNO,FHappenComNO,FContainerNO,FCurDate,Fcredence,FAccountDate", "1");

            conn1["isArchive"] = false;

            conn1["isDefaultDate"] = Index.defaultDate == $("#FAccountDate1").val();

            var $gridList1 = $("#gridList1");///BOM/Blankingcard/GetBlankingcards

            $gridList1.dataGridForJson({
                url: "/WareHouse/Container/GetContainerRepair",
                postData: conn1,
                height: $(window).height() - 220,
                colModel: [
                { label: '选择', name: "FDocuNO", width: 40, align: 'center', sortable: false, formatter: $.checkbox, unformat: $.empty },
                    { label: '编号', name: "FDocuListID", width: 40, align: 'center', sortable: false, hidden: true },
                    { label: '发生方式（隐藏）', name: 'FDocuTypeNo', width: 120, align: 'left', sortable: false, hidden: true },
                    { label: '发生方式', name: 'FDocuTypeName', width: 80, align: 'center', sortable: false },
                    { label: '单据编号', name: 'FDocuNO', width: 160, align: 'center', sortable: false },
                    { label: '单据日期', name: 'FCurDate', width: 80, align: 'center', sortable: false },
                    { label: '来料单位', name: 'FHappenComNO', width: 80, align: 'center', sortable: false },
                    { label: '来料单位名称', name: 'FHappenComName', width: 120, align: 'left', sortable: false },
                    { label: '容器编号', name: 'FContainerNO', width: 80, align: 'center', sortable: false },
                    { label: '容器名称', name: 'FContainerName', width: 80, align: 'center', sortable: false },
                    { label: '开票<br/>数量', name: 'FQuantity_KP', width: 60, align: 'right', sortable: false },
                    { label: '实际<br/>数量', name: 'FQuantity', width: 60, align: 'right', sortable: false },
                    { label: '单价<br/>(元)', name: 'FPrice', width: 60, align: 'right', sortable: false, },
                    { label: '金额<br/>(元)', name: 'FAmount', width: 60, align: 'right', sortable: false, },
                    { label: '容器分类(隐藏)', name: 'FContainerTypeNO', width: 120, align: 'right', sortable: false, hidden: true },
                   { label: '容器分类', name: 'FContainerTypeName', width: 120, align: 'left', sortable: false, },
                    { label: '凭证编号', name: 'FCredence', width: 120, align: 'left', sortable: false, },
                    { label: '备注说明', name: 'FDescription', width: 160, align: 'left', sortable: false },
                    { label: '输入人员', name: 'FCreateBy', width: 80, align: 'center', sortable: false },
                    { label: '输入日期', name: 'FCreateDate', width: 80, align: 'center', sortable: false },
                    { label: '输入时间', name: 'FCreateTime', width: 80, align: 'center', sortable: false },
                    { label: '审核人员', name: 'FAuditingBy', width: 80, align: 'center', sortable: false },
                    { label: '审核日期', name: 'FAuditingDate', width: 80, align: 'center', sortable: false },
                    { label: '审核时间', name: 'FAuditingTime', width: 80, align: 'center', sortable: false },
                    { label: '仓库编号', name: 'FStoreNO', width: 80, align: 'center', sortable: false, hidden: true },
                    { label: '仓库定置号', name: 'FStoreSetNO', width: 80, align: 'center', sortable: false, hidden: true },
                    { label: ' 单据目录ID', name: 'FDocuID', width: 80, align: 'center', sortable: false, hidden: true },
                    { label: ' 台帐日期', name: 'FAccountDate', width: 80, align: 'center', sortable: false, hidden: true },
                    { label: ' 摘要说明', name: 'FDescription_DOC', width: 120, align: 'center', sortable: false, hidden: true }

                ],
                pager: "#gridPager1",
                sortname: 'UseUnit,FAccountDate,FDocuNO',
                sortorder: "asc,asc,DESC",
                viewrecords: true,
                rownumWidth: 50,
                onSelectRow: function (rowId) {
                    Index.selected = $gridList1.jqGrid('getRowData', rowId);

                    var cols = "FDocuNO,FPrice,FContainerNO,FQuantity".split(",");

                    cols.forEach(function (col) {
                        $("#{0}".format(col)).val(Index.selected[col]);
                    });
                },
                loadComplete: function (data) {
                    Index.dataList["登记"] = data;
                }
            });

            $gridList1.jqGrid('setFrozenColumns');

            $gridList1.jqGrid('setLabel', 0, '序号', 'rowNumberHeaderStyle');

            var conn2 = $.buildPostParam("FDocuNO,FHappenComNO,FContainerNO,FCurDate,Fcredence,FAccountDate", "1");

            conn2["isArchive"] = true;

            conn2["isDefaultDate"] = Index.defaultDate == $("#FAccountDate1").val();

            var $gridList2 = $("#gridList2");

            $gridList2.dataGridForJson({
                url: "/WareHouse/Container/GetContainerRepair",
                postData: conn2,
                height: $(window).height() - 220,
                colModel: [
                    { label: '选择', name: "FDocuNO", width: 40, align: 'center', sortable: false, formatter: $.checkbox, unformat: $.empty },
                    { label: '编号', name: "FDocuListID", width: 40, align: 'center', sortable: false, hidden: true },
                    { label: '发生方式（隐藏）', name: 'FDocuTypeNo', width: 120, align: 'left', sortable: false, hidden: true },
                    { label: '发生方式', name: 'FDocuTypeName', width: 80, align: 'center', sortable: false },
                    { label: '单据编号', name: 'FDocuNO', width: 160, align: 'center', sortable: false },
                    { label: '单据日期', name: 'FCurDate', width: 80, align: 'center', sortable: false },
                    { label: '来料单位', name: 'FHappenComNO', width: 80, align: 'center', sortable: false },
                    { label: '来料单位名称', name: 'FHappenComName', width: 120, align: 'left', sortable: false },
                    { label: '容器编号', name: 'FContainerNO', width: 80, align: 'center', sortable: false },
                    { label: '容器名称', name: 'FContainerName', width: 80, align: 'center', sortable: false },
                    { label: '开票<br/>数量', name: 'FQuantity_KP', width: 60, align: 'right', sortable: false },
                    { label: '实际<br/>数量', name: 'FQuantity', width: 60, align: 'right', sortable: false },
                    { label: '单价<br/>(元)', name: 'FPrice', width: 60, align: 'right', sortable: false, },
                    { label: '金额<br/>(元)', name: 'FAmount', width: 60, align: 'right', sortable: false, },
                    { label: '容器分类(隐藏)', name: 'FContainerTypeNO', width: 120, align: 'right', sortable: false, hidden: true },
                   { label: '容器分类', name: 'FContainerTypeName', width: 120, align: 'left', sortable: false, },
                    { label: '凭证编号', name: 'FCredence', width: 120, align: 'left', sortable: false, },
                    { label: '备注说明', name: 'FDescription', width: 160, align: 'left', sortable: false },
                    { label: '输入人员', name: 'FCreateBy', width: 80, align: 'center', sortable: false },
                    { label: '输入日期', name: 'FCreateDate', width: 80, align: 'center', sortable: false },
                    { label: '输入时间', name: 'FCreateTime', width: 80, align: 'center', sortable: false },
                    { label: '审核人员', name: 'FAuditingBy', width: 80, align: 'center', sortable: false },
                    { label: '审核日期', name: 'FAuditingDate', width: 80, align: 'center', sortable: false },
                    { label: '审核时间', name: 'FAuditingTime', width: 80, align: 'center', sortable: false },
                    { label: '仓库编号', name: 'FStoreNO', width: 80, align: 'center', sortable: false, hidden: true },
                    { label: '仓库定置号', name: 'FStoreSetNO', width: 80, align: 'center', sortable: false, hidden: true },
                    { label: ' 单据目录ID', name: 'FDocuID', width: 80, align: 'center', sortable: false, hidden: true },
                    { label: ' 台帐日期', name: 'FAccountDate', width: 80, align: 'center', sortable: false, hidden: true },
                    { label: ' 摘要说明', name: 'FDescription_DOC', width: 120, align: 'center', sortable: false, hidden: true }
                ],
                pager: "#gridPager2",
                sortname: 'UseUnit,FAccountDate,FDocuNO',
                sortorder: "asc,asc,DESC",
                viewrecords: true,
                rownumWidth: 50,
                onSelectRow: function (rowId) {

                },
                loadComplete: function (data) {
                    Index.dataList["档案"] = data;
                }
            });

            $gridList2.jqGrid('setFrozenColumns');

            $gridList2.jqGrid('setLabel', 0, '序号', 'rowNumberHeaderStyle');
        },
        buildPrintData: function (data, columnInfos) {
            var pageItem = $("<div>").addClass("page"), table = $("<table>"), cols = [];

            data.dataList.forEach(function (item) {
                !!cols.length || (function () {
                    var header = $("<tr>");

                    for (var idx in item) {
                        cols.push(idx);

                        $("<th>").html(columnInfos[idx]).appendTo(header);
                    }

                    header.appendTo(table);
                })();

                !!cols.length && (function () {
                    var tr = $("<tr>");

                    for (var idx in cols) {
                        $("<td>").html(item[cols[idx]]).appendTo(tr);
                    }

                    tr.appendTo(table);
                })();
            });

            data["table"] = "<table>{0}</table>".format(table.html());

            pageItem.html(Index.printItemTemplate.format(data));

            return pageItem;
        },
        buildSql: function (pars, suffix, colInfo, tableName) {
            var param = { sql: "" }, conn = "", cols = [];

            !suffix && (suffix = "");

            param.sql = "SELECT {2} FROM {3} where useunit = '{1}' and FDocuTypeNo={4} {0}";

            pars.forEach(function (item) {
                var val = $("#{0}{1}".format(item, suffix)).val();

                !!val && (conn += " and {0} = '{1}'".format(item, val));
            });

            colInfo.forEach(function (item) {
                cols.push("{name} {caption}".format(item));
            });

            param.sql = param.sql.format(conn, Index.curUnit, cols.join(","), tableName,Index.FDocuTypeNo);

            console.log(param.sql);

            return param;
        }
    };
</script>

<div class="layout" id="layout" style="height: 100%; width: 100%;">
    <div class="tool_c">
        <div class="btn-group">
            <input id="ra11" name="ra1" value="登记" checked="checked" type="radio" /><label for="ra11">登记</label><br />
            <input id="ra12" name="ra1" value="档案" type="radio" /><label for="ra12">档案</label>
        </div>
       <div class="btn-group  input-width-105">
            &nbsp;单据编号<br />
            <input id="FDocuNO1" style="width: 140px;" class="form-control" type="text" />
        </div>
        <div class="btn-group input-width-120">
            &nbsp;返修单位<br />
            <select id="FHappenComNO1" style="width: 100px;" class="form-control required">
                <option value="">==请选择==</option>
            </select>
        </div>
        <div class="btn-group  input-width-105">
            &nbsp;容器编号<br />
            <input id="FContainerNO1" style="width: 140px;" class="form-control" type="text" />
            <input id="FDocuTypeNo1" type="hidden" value="RG" />
        </div>
        <div class="btn-group  input-width-105">
            &nbsp;返修日期<br />
            <input id="FCurDate1" style="width: 140px;" class="form-control" type="text" my97date="yyyy-MM-dd" />
        </div>
        <div class="btn-group  input-width-80">
            &nbsp;凭证编号<br />
            <input id="Fcredence1" style="width: 140px;" class="form-control" type="text" />
        </div>
        <div class="btn-group  input-width-80">
            &nbsp;台账日期<br />
            <input id="FAccountDate1" style="width: 140px;" class="form-control" type="text" month-control />
        </div>

        <div id="butn_c_1" class="btn-group">
            <a id="btn_search1" class="btn btn-primary center-block r1 r11"><span class="glyphicon glyphicon-search"></span>&nbsp查询</a>
            <a class="btn btn-primary center-block" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span>&nbsp刷新</a>
            <a id="butnAdd1" class="btn btn-primary center-block r1 r12"><span class="glyphicon glyphicon-plus"></span>&nbsp输入</a>
            <a id="butnDelete1" class="btn btn-primary center-block r1 r13"><span class="glyphicon glyphicon-trash"></span>&nbsp删除</a>
            <a id="butnUpdate1" class="btn btn-primary center-block r1 r14"><span class="glyphicon glyphicon-edit"></span>&nbsp修改</a>
            <a id="butnAudit1" class="btn btn-primary center-block r1 r15"><span class="glyphicon glyphicon-user"></span>&nbsp审核</a>
            <a id="butnToRed1" class="btn btn-primary center-block r1 r20"><span class="glyphicon glyphicon-flag"></span>&nbsp冲红</a>
            <a id="butnGoBill1" class="btn btn-primary center-block r1 r21"><span class="glyphicon glyphicon-list-alt"></span>&nbsp单据</a>
            <a id="butnPrint1" class="btn btn-primary center-block r1 r16"><span class="glyphicon glyphicon-print"></span>&nbsp打印</a>
            <a id="butnExport1" class="btn btn-primary center-block r1 r17"><span class="glyphicon glyphicon-share"></span>&nbsp导出</a>
        </div>
        <div id="butn_c_2" class="btn-group display_none">
            <a id="butnUpdate2" class="btn btn-primary center-block r1 r14"><span class="glyphicon glyphicon-plus"></span>&nbsp修改</a>
            <a id="butnClose" class="btn btn-primary center-block r1 r15"><span class="glyphicon glyphicon-remove"></span>&nbsp关闭</a>
        </div>
    </div>
    <div id="popup" class="display_none">
        <div class="item">
            <label>
                单据编号
            </label>
            <div class="input_c">
                <input id="FDocuNO" class="form-control" type="text" />
            </div>
        </div>
        <div class="item">
            <label>
                容器单价
            </label>
            <div class="input_c input_c_s input_c_num">
                <input id="FPrice" class="form-control" type="text" />
            </div>
            <div class="after">
                元
            </div>
        </div>
        <div class="item">
            <label>
                容器编号
            </label>
            <div class="input_c input_c_n">
                <input id="FContainerNO" class="form-control" type="text" />
            </div>
        </div>
        <div class="item">
            <label>
                实际数量
            </label>
            <div class="input_c input_c_s input_c_num">
                <input id="FQuantity" class="form-control" type="text" />
            </div>
            <div class="after">件</div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="grid_list_1_c  r1 r18" style="margin-top: 5px;">
        <table id="gridList1"></table>
        <div id="gridPager1"></div>
        <div id="print1" class="print">
            <div class="page">
                <header>
                    <h2>{unitName}</h2>
                    <h1>{title}</h1>
                    <aside>
                        <img src="{bar_code}" alt="bar_code" title="bar_code" />
                        <img src="{qr_code}" alt="qr_code2" title="qr_code2" />
                    </aside>
                </header>
                <section>
                    <div class="item item_r">
                        <label>单据编号:</label>{FDocuNO}
                    </div>
                    <div class="item">
                        <label>领料单位:</label>{FHappenComName}
                    </div>
                    <div class="item">
                        <label>入库日期:</label>{FCurDate}
                    </div>
                    <div class="item">
                        <label>摘要说明:</label>{FDescription_DOC}
                    </div>
                </section>
                <div class="table_c">
                    {table}
                </div>
                <footer>
                    <div class="line">
                        <aside>
                            <div class="item">
                                <label>合计：{total}</label>
                            </div>
                            <div class="item">
                                <label>开票数量合计：{bill_total}</label>
                            </div>
                            <div class="item">
                                <label>实际数量合计：{real_total}</label>
                            </div>
                            <div class="item">
                                <label>金额合计：{amount_total}</label>
                            </div>
                        </aside>
                    </div>
                    <div class="line">
                        <div class="item item_r">
                            <span>第{page}页 </span><span>共{total_page}页</span>
                        </div>
                        <div class="item">
                            <label>打印人员：</label>{curUser}
                        </div>
                        <div class="item">
                            <label>打印日期：</label>{curDate}
                        </div>
                        <div class="item">
                            <label>打印时间：</label>{curTime}
                        </div>
                    </div>
                </footer>
            </div>
        </div>
    </div>
    <div class="grid_list_1_c  r1 r19" style="margin-top: 5px;">
        <table id="gridList2"></table>
        <div id="gridPager2"></div>
        <div id="print2" class="print"></div>
    </div>
</div>



